package com.ysd.lis.controller.bac;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.bac.BacStrainLog;
import com.ysd.lis.service.bac.BacStrainLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 细菌过程记录 前端控制器
 * </p>
 *
 * @author wanghao
 * @since 2024-04-13
 */
@RestController
@RequestMapping("/bac/strainLog")
public class BacStrainLogController extends BaseController {

    @Autowired
    BacStrainLogService bacStrainLogService;

    @ApiOperation("查询")
    @GetMapping("/findStrainLogList")
    public Result findStrainLogList(BacStrainLog bacStrainLog) {
        return bacStrainLogService.findStrainLogList(bacStrainLog);
    }

    @ApiOperation("增加")
    @PostMapping("/addStrainLog")
    public Result addStrainLog(@RequestBody BacStrainLog bacStrainLog) {
        boolean b = bacStrainLogService.save(bacStrainLog);
        if (b) {
            return Result.succ(1, "新增成功！", null);
        } else {
            return Result.fail("新增成功！");
        }
    }
}
